<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopContract extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_contract', function (Blueprint $table) {
            $table->increments('id');
            $table->string('shopid')->comment('商家ID');
            $table->string('contractorid')->comment('签约人ID');
            $table->date('starttime')->comment('合同开始时间');
            $table->date('lasttime')->comment('合同结束时间');
            $table->integer('eventdays')->default(0)->comment('活动累计天数');
            $table->tinyInteger('statementeventdays')->default(0)->comment('累计已结算天数');
            $table->decimal('commission',16,2)->default(0)->comment('累计发放活动日提成佣金');
            $table->decimal('newshoppercentage',16,2)->default(0)->comment('累计发放新店佣金');
            $table->decimal('performancepercentage',16,2)->default(0)->comment('累计发放绩效佣金');
            $table->decimal('halfdeductions',16,2)->default(0)->comment('累计扣款一半金额');
            $table->decimal('totaldeductions',16,2)->default(0)->comment('累计扣款总金额');
            $table->tinyInteger('deductionstatus')->default(0)->comment('扣除状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
